/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.V020;
import queenb.net.entitybean.V020;
import queenb.web.util.PackageContants;

/**
 *
 * @author Hung.Ngo
 */
public class V020Store extends V020 {

    public int updateV020(int pnFV050, int pnFN100, String pvVV021, String pvVV022, String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_PERSONALDD, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFV050),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.CHAR, pvVV021),
                        new Param(OracleTypes.CHAR, pvVV022),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, V020.class);
        } catch (SQLException ex) {
            Logger.getLogger(V020Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
    
    public List<V020> getListV020(int pnFH000, int pnFH200,int pnFV050, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_PERSONALDD, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                      new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        return super.find(dataStatement, V020.class);
    }
    
     public int deleteV020(int pnPV020, String pvLOGIN) {
       try {
            DataStatement dataStatement = new DataStatement(PackageContants.DELETE_PERSONALDD, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPV020),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dataStatement, V020.class);
        } catch (SQLException ex) {
            Logger.getLogger(S250Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
}
